const fs = require('fs')
const path = require('path')
const data = fs.readFileSync(path.join(__dirname, './info.json'), 'utf-8')
const data1 = JSON.parse(data)
console.log(data1);
const random = Math.floor(Math.random() * data1.length)
console.log(random);
const sum = data1.reduce(function (pre, cur) {
    return pre+cur.id
}, 0)
console.log(sum);
fs.writeFileSync("./info.json",JSON.stringify(data))